<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use App\Models\Battery;

class BetteryTestController extends Controller
{
    public function index(){
        
        return view('batteryTest');

    }

    public function setSimulation(Request $request){
        $param = $request->all();
        $huaweiId = '61b7f6902b2aa20288bbbbd7_Battery_monitor_01';
        Battery::setSwitchStatus($huaweiId, $param['val']);
        return response()->json(['code'=>1, 'msg' => '执行成功']);
    }
}